package com.amin.app.web.entity;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

public class SUsers implements Serializable, UserDetails {
    /** 主键 */
    private Integer id ;
    /** 用户名 */
    private String username ;
    /** 密码 */
    private String password ;
    /** 昵称 */
    private String userNick ;
    /** 头像 */
    private String userPicture ;
    /** 性别;1男2女 */
    private String sex ;
    /** 顺序 */
    private Integer sort ;
    /** 部门id */
    private Integer depId ;
    /** 部门名称 */
    private String depName ;
    /** 创建时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createdTime ;
    /** 删除表示;0正常1删除 */
    private String deleted ;
    /** 备注 */
    private String remarks ;
    /** 角色id */
    private Integer roleId;
    /** 启用 */
    private String enabled;



    /** 主键 */
    public Integer getId(){
        return this.id;
    }
    /** 主键 */
    public void setId(Integer id){
        this.id = id;
    }
    /** 用户名 */
    public String getUserName(){
        return this.username;
    }
    /** 用户名 */
    public void setUserName(String username){
        this.username = username;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        Collection<? extends GrantedAuthority> grantedAuthorities = roleId == null ? new ArrayList<SimpleGrantedAuthority>() : null;
        return grantedAuthorities;
    }

    /** 密码 */
    public String getPassword(){
        return this.password;
    }

    @Override
    public String getUsername() {
        return this.username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }

    /** 密码 */
    public void setPassword(String password){
        this.password = password;
    }
    /** 昵称 */
    public String getUserNick(){
        return this.userNick;
    }
    /** 昵称 */
    public void setUserNick(String userNick){
        this.userNick = userNick;
    }
    /** 头像 */
    public String getUserPicture(){
        return this.userPicture;
    }
    /** 头像 */
    public void setUserPicture(String userPicture){
        this.userPicture = userPicture;
    }
    /** 性别;1男2女 */
    public String getSex(){
        return this.sex;
    }
    /** 性别;1男2女 */
    public void setSex(String sex){
        this.sex = sex;
    }
    /** 顺序 */
    public Integer getSort(){
        return this.sort;
    }
    /** 顺序 */
    public void setSort(Integer sort){
        this.sort = sort;
    }
    /** 部门id */
    public Integer getDepId(){
        return this.depId;
    }
    /** 部门id */
    public void setDepId(Integer depId){
        this.depId = depId;
    }
    /** 部门名称 */
    public String getDepName(){
        return this.depName;
    }
    /** 部门名称 */
    public void setDepName(String depName){
        this.depName = depName;
    }
    /** 创建时间 */
    public Date getCreatedTime(){
        return this.createdTime;
    }
    /** 创建时间 */
    public void setCreatedTime(Date createdTime){
        this.createdTime = createdTime;
    }
    /** 删除表示;0正常1删除 */
    public String getDeleted(){
        return this.deleted;
    }
    /** 删除表示;0正常1删除 */
    public void setDeleted(String deleted){
        this.deleted = deleted;
    }
    /** 备注 */
    public String getRemarks(){
        return this.remarks;
    }
    /** 备注 */
    public void setRemarks(String remarks){
        this.remarks = remarks;
    }
    /** 角色id */
    public Integer getRoleId(){
        return this.roleId;
    }
    /** 角色id */
    public void setRoleId(Integer roleId){
        this.roleId = roleId;
    }
    /** 启用 */
    public String getEnabled() {
        return enabled;
    }
    /** 启用 */
    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }
}
